// GTY

#pragma once

#include "CoreMinimal.h"
#include "AbilitySystem/Abilities/AuraProjectileSpell.h"
#include "AuraFireBolt.generated.h"

/**
 * 
 */
UCLASS()
class AURAGAME_API UAuraFireBolt : public UAuraProjectileSpell
{
	GENERATED_BODY()

public:
	virtual FString GetDescription(int32 Level) override; //获取当前等级的技能描述
	virtual FString GetNextLevelDescription(int32 Level) override; //获取技能下一等级的技能描述

	FString GetDescriptionAtLevel(int32 Level, const FString& Title); //获取对应等级的技能描述

	//发射多个火球
	UFUNCTION(BlueprintCallable, Category="Projectile")
	void SpawnProjectiles(const FVector& ProjectileTargetLocation, const FGameplayTag& SocketTag, const FName SocketName, const bool bOverridePitch = false, const float PitchOverride = 0.f, AActor* HomingTarget = nullptr);

	//获取火球发射方向
	UFUNCTION(BlueprintCallable, Category="Projectile")
	FVector GetForward(const FVector& ProjectileTargetLocation, const FGameplayTag& SocketTag,const bool bOverridePitch, const float PitchOverride);

	//单次发射
	UFUNCTION(BlueprintCallable, Category="Projectile")
	void SpawnOneProjectile(const FVector& ProjectileTargetLocation, const FGameplayTag& SocketTag, AActor* HomingTarget = nullptr,FRotator Rotator = FRotator::ZeroRotator);
	
protected:

	UPROPERTY(EditDefaultsOnly, Category="FireBolt")
	float ProjectileSpread = 90.f; //攻击角度

	UPROPERTY(EditDefaultsOnly, Category="FireBolt")
	int32 MaxNumProjectiles = 5; //最大生成火球数量

	UPROPERTY(EditDefaultsOnly, Category="FireBolt")
	float HomingAccelerationMin = 1600.f; //移动朝向目标的最小加速度

	UPROPERTY(EditDefaultsOnly, Category="FireBolt")
	float HomingAccelerationMax = 3200.f; //移动朝向目标的最大加速度

	UPROPERTY(EditDefaultsOnly, Category="FireBolt")
	bool bLaunchHomingProjectiles = true; //设置生成的飞弹是否需要朝向目标飞行

};

